package com.zh.room;

import com.zh.article.DrugSet;
import com.zh.article.WeaponSet;
import com.zh.creature.MonsterTigerSet;
import com.zh.creature.MonsterWolfSet;

import java.util.HashMap;

/**
 * @description:
 * @author: zhangHang
 * @date: Created in 2020/5/20 23:03
 * @version: V1.0
 * @modified By:
 */
public class Room {
    private String id;
    private String description;
    private MonsterWolfSet monsterWolfSet = new MonsterWolfSet();//每个房间里的狼集合。
    private MonsterTigerSet monsterTigerSet = new MonsterTigerSet();//每个房间的老虎集合。
    private WeaponSet weaponSet = new WeaponSet();//每个房间的武器集合
    private DrugSet drugSet = new DrugSet();//每个房间的药品集合
    private HashMap<String, Room> reachableRooms = new HashMap<>();//房间的通道

    public Room(){

    }

    public Room(String id, String description){
        this.id=id;
        this.description=description;
    }

    public void removeWeapon(String id){
        this.getWeaponSet().remove(id);
    }

    public void removeDrug(String id){this.getDrugSet().remove(id);}

    public void addReachableRoom(String roomId, Room room){
        reachableRooms.put(roomId,room);
    }

    public Room goReachableRoomById(String targetRoomId, HashMap<String, Room> reachableRooms){
        Room room = null;
        if(reachableRooms.containsKey(targetRoomId)){
            room=reachableRooms.get(targetRoomId);
        }
        return room;
    }

    @Override
    public String toString(){
        return this.description;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public HashMap<String, Room> getReachableRooms() {
        return reachableRooms;
    }

    public void setReachableRooms(HashMap<String, Room> reachableRooms) {
        this.reachableRooms = reachableRooms;
    }

    public MonsterWolfSet getMonsterWolfSet() {
        return monsterWolfSet;
    }

    public void setMonsterWolfSet(MonsterWolfSet monsterWolfSet) {
        this.monsterWolfSet = monsterWolfSet;
    }

    public WeaponSet getWeaponSet() {
        return weaponSet;
    }

    public void setWeaponSet(WeaponSet weaponSet) {
        this.weaponSet = weaponSet;
    }

    public DrugSet getDrugSet() {
        return drugSet;
    }

    public void setDrugSet(DrugSet drugSet) {
        this.drugSet = drugSet;
    }

    public MonsterTigerSet getMonsterTigerSet() {
        return monsterTigerSet;
    }

    public void setMonsterTigerSet(MonsterTigerSet monsterTigerSet) {
        this.monsterTigerSet = monsterTigerSet;
    }
}
